package 集合泛型;

import java.util.TreeMap;

public class TreeMap1 {
    public static void main(String[] args) {
        //自动为升序
        TreeMap<String,Integer> tm=new TreeMap<String, Integer>();
       //降序
       // TreeMap<Integer,String> fm=new TreeMap<>((a,b)->b-a);
       // fm.put(4,"java");
      // fm.put(1,"java");
       // fm.put(2,"java");
     //   fm.put(5,"java");

        tm.put("java",500);
        tm.put("python",620);
        tm.put("javascript",450);
        tm.put("c",300);
        tm.put("go",520);
        tm.put("php",360);
        System.out.println(tm);//自动排序 按照key的值
        System.out.println(tm.keySet());
        System.out.println(tm.values());
    }
}
